
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all="camelCase")]
pub struct AppConfig {
  pub app_name: String,
  url_path_prefix: Option<String>,
  server_name: Option<String>,
}

impl AppConfig {
  pub fn get_url_prefix(&self) -> String {
    self.url_path_prefix.clone().unwrap_or(self.app_name.clone())
  }

  pub fn get_server_name(&self) -> String {
    self.server_name.clone().unwrap_or(self.app_name.clone())
  }
}
